package day10;

import java.util.Scanner;

public class TeacherTest {
    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner(System.in);
        try {
            System.out.println("请输入老师的姓名：");
            String name = input.next();
            System.out.println("请输入老师的年龄：");
            int age = input.nextInt();
            if (age < 22) {
                throw new Exception("年龄异常");
            }
            System.out.println("请输入老师的学校：");
            String school = input.next();
            Teacher t = new Teacher(age, school, name);
            t.selfIntro();
            t.startClass();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}